package jp.tf_web.httpserversample;

import jp.tf_web.httpserversample.http.HttpServer;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class Main extends Activity {
	private final HttpServer _server;
	
	public Main(){
		super();
		this._server = new HttpServer(this,8888);
	}
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.main);
        
        String ip_str = this._server.getIPAddrStr(); 
        String port_str = this._server.getPortStr();
        
        TextView display = (TextView) this.findViewById(R.id.display);
        display.setText("IP:"+ip_str+":"+port_str);
        
        //サーバー開始
        this._server.start();
    }
}